<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="<c:url value="/css/style.css" />" rel="stylesheet" type="text/css" media="screen" />
<title>Insert title here</title>
</head>
<body>
<div id="wrapper">
	<div id="header">
		<div id="logo">
			<a href="<%=request.getContextPath()%>/index.jsp"><img align="left" width="340px" height="185px" src="<c:url value="/images/foodgod2.png" />"></a>
			  
		</div>
		<div id="Search">     
		<c:if test="${empty user}">
			<c:if test="${empty manager}">
                <form method="post" action="<c:url value="/top/login.controller" />">
				<fieldset>
					帳號<input type="text" name="username" id="username"  value="" /><a href="<c:url value="/member/Registered.jsp" />">加入會員</a>
					<br />
					密碼<input type="password" name="password" id="password"  value="" />
					${errors.password}
					<input type="submit" id="login" value="登入" />
				</fieldset>
			
			</form>
			</c:if>
              </c:if>
              <c:if test="${not empty user }">
              <form>
				<fieldset>
				
					<h3>
					
					Hello~<a href='<c:url value="/member/MyRecipe" />'>${user.mbname}
					<img height='80' width='80' src='${pageContext.servletContext.contextPath}/getImg?id=${user.mbid}&type=MEMBER' >
					</h3>
					</a>
					<a href="<c:url value="/login/LogoutServlet" />">登出</a>
					
				</fieldset>
                </form>
              </c:if>
              <c:if test="${not empty manager }">
              <form>
				<fieldset>
					<h3>
					我是管理員~${manager.mgname}
					</h3>
					
					
					<a href="<c:url value="/login/LogoutServlet" />">登出</a>
					
				</fieldset>
                </form>
              </c:if>
			
		</div>
	</div>
	<!-- end #header -->
	<div id="page">
		<div id="page-bgtop">
			<div id="page-bgbtm">
				<div id="menu">
					<ul>
					
						
						
						<li><a href="<%=request.getContextPath()%>/ViewRecipeServlet?pageNumber=0"><font style="font-size:0.5cm">食譜</font></a></li>
						
						<li><a href="<%=request.getContextPath()%>/calorie/calorie.jsp"><font style="font-size:0.5cm">熱量</font></a></li>
						<li><a href="<%=request.getContextPath()%>/course/DisplayCourse"><font style="font-size:0.5cm">課程</font></a></li>
						<li><a href="<%=request.getContextPath()%>/shopping/DisplayProduct?action=serch_all&pageNumber=0"><font style="font-size:0.5cm">影片</font></a></li>
						<c:if test="${empty manager }">
						<li><a href="<%=request.getContextPath()%>/recipe/writerecipe.jsp"><font style="font-size:0.5cm">寫食譜</font></a></li>
						<li><a href="<%=request.getContextPath()%>/member/MyRecipe"><font style="font-size:0.5cm">會員首頁</font></a></li>
						</c:if>
					</ul>
				</div>
				</div>
				</div>
				</div>
				</div>
				
</body>
</html>